<div class="centercontent tables">
<div class="pageheader notab">
<h1 class="pagetitle">Modul Agenda</h1>
<span class="pagedesc">
Nama Agenda : <?php echo $nama_agenda; ?>, Tanggal Pelaksanaan : <?php echo $tanggal_agenda; ?>
</span> </div>
<!--pageheader-->
<div id="contentwrapper" class="contentwrapper"><br />
<div class="tombol_tambah" align="right">   
<?php 
	$role_jabatan = $this->session->userdata('id_jabatan');
  if(($role_jabatan == '2' || $role_jabatan == '4' || $boleh_lihat== 'true') && ($status != 'Tidak diliput' && $status != 'Batal' && $status != 'Finish') && $this->session->userdata('id_organisasi') == $id_org) {
?>
<a href="<?php echo base_url(); ?>index.php/peminjaman_barang/add_process/<?php echo $id_agenda; ?>"><button class="stdbtn btn_blue">Tambah Peminjaman Barang</button></a>
<?php } ?>
<button onclick="location.href='<?php echo base_url(); ?>index.php/agenda/detail_agenda/<?php echo $id_agenda; ?>'" class="stdbtn btn_orange"><< Kembali ke Detail Agenda</button>
</div>
<div class="contenttitle2">
<h3>Daftar Peminjaman Barang</h3>
</div>
<!--contenttitle-->
<?php if($this->session->flashdata('sukses') != ''){ ?>
                   <div class="notibar msgsuccess">
                        <a class="close"></a>
                        <p><?php echo $this->session->flashdata('sukses'); ?></p>
                    </div>
					<?php } else if($this->session->flashdata('gagal') != ''){ ?>
					<div class="notibar msgerror">
                        <a class="close"></a>
                        <p><?php echo $this->session->flashdata('gagal'); ?></p>
                    </div>
					<?php 
					}
					?>
<?php if($peminjaman_barang->num_rows() > 0){?>
<table class="stdtable" id="dyntable" border="0" cellpadding="0" cellspacing="0">
<colgroup><col class="con0" /><col class="con1" /><col class="con0" /><col class="con1" /><col class="con0" /></colgroup> 
<thead> 
<tr>
	<th class="head0">Kode Barang</th>
	<th class="head1">Nama Barang</th>
	<th class="head0">Peminjam</th>
	<th class="head1">Tanggal Pinjam</th>
	<th class="head0">Tanggal Kembali</th>
	<th class="head1">Status</th>
	<th class="head0">Kondisi Barang</th>	
	<th class="head1">Aksi</th>
</tr>
</thead> 
<tfoot> 
	<th class="head0">Kode Barang</th>
	<th class="head1">Nama Barang</th>
	<th class="head0">Peminjam</th>
	<th class="head1">Tanggal Pinjam</th>
	<th class="head0">Tanggal Kembali</th>
	<th class="head1">Status</th>
	<th class="head0">Kondisi Barang</th>
	<th class="head1">Aksi</th>
	</tr>
</tfoot> 
<tbody>
	<?php 
						foreach($peminjaman_barang->result() as $row){			
			 		?>
	<tr class="gradeX">
	<td><a href="<?php echo base_url().'index.php/pengelolaan_inventaris/detail_barang/'.$row->kode_barang; ?>"><?php echo $row->kode_barang; ?></a></td>
	<td><a href="<?php echo base_url().'index.php/pengelolaan_inventaris/detail_barang/'.$row->kode_barang; ?>"><?php echo $row->nama_barang.' ('.$row->keterangan.')'; ?></a></td>
	<td><?php echo $row->nama_anggota; ?></td>
	<td><?php echo date('d F Y', strtotime($row->tanggal_pinjam)).' ('.$row->jam_pinjam.')'; ?></td>
	<td><?php echo date('d F Y', strtotime($row->tanggal_kembali)).' ('.$row->jam_kembali.')'; ?></td>
	<td><?php echo $row->status_peminjaman; ?></td>
	<td><?php echo $row->kondisi_barang; ?></td>
	<td align="center">
	<a href="<?php echo base_url().'index.php/peminjaman_barang/detail_peminjaman_barang/'.$row->id_peminjaman; ?>" title='Detail' class="btn btn4 btn_yellow btn_search radius50" alt="Detail"></a>
	<?php 
	$role_jabatan = $this->session->userdata('id_jabatan');
	if(($role_jabatan == '2' || $role_jabatan == '4' || $this->session->userdata('id_user') == $row->id_anggota) && ($status != 'Tidak diliput' && $status != 'Batal' && $status != 'Finish') && $this->session->userdata('id_organisasi') == $id_org) {
	?>
	<a href="<?php echo base_url().'index.php/peminjaman_barang/edit_proses/'.$row->id_peminjaman; ?>" title='Edit' class="btn btn4 btn_yellow btn_flag" alt="Edit"></a>
	<a href="<?php echo base_url().'index.php/peminjaman_barang/hapus_peminjaman_barang/'.$row->id_peminjaman; ?>" title='Delete' class="btn btn4 btn_yellow btn_trash" alt="Delete" onclick="return confirm('Apa Anda yakin untuk menghapus data peminjaman barang <?php echo $row->nama_barang.' ('.$row->keterangan.')'; ?> ?')" ></a>
	<?php
	}	
	?>	
	</td>
  </tr>
	 <?php
					  }
			  		?> 
</tbody>
</table>
<?php } else { echo 
						 '<div class="notibar msginfo">
							<p>Data Peminjaman Barang Belum Ada.</p>
						  </div>';
					}
			  		?> 
<!--contenttitle--></div>
<!--contentwrapper--> </div>
<!-- centercontent -->